package com.springboot.demo.service;

import com.springboot.demo.entity.*;
import com.springboot.demo.utils.Constant;
//import com.springboot.demo.entity.TableDataTable;

import java.security.Principal;
import java.util.Date;
import java.util.List;

/**
 * @author wubc683
 * @desc
 * @date 2021-11-18 17:07
 */
public interface TableService {

    /**
     * 获取所有表格
     * @param uid
     * @param search
     * @param type
     * @param sort
     * @param startDate
     * @param endDate
     * @param pageRequest
     * @return: com.springboot.demo.entity.PageResult
     */
    PageResult getAllTables(Long uid, String search, Integer type, String sort,Date startDate, Date endDate,
                            PageRequest pageRequest);

    /**
     * 获取报表信息
     * @param uid
     * @param tid
     * @return: com.springboot.demo.entity.Table
     */
    Table getTable(Long uid, Long tid);

    /**
     * 创建报表
     * @param uid
     * @param table
     * @return: void
     */
    void saveTable(Long uid, Table table);

    /**
     * 修改报表
     * @param uid
     * @param table
     * @return: void
     */
    void updateTable(Long uid, Table table);

    /**
     * 删除报表
     * @param uid
     * @param tableIds
     * @return: void
     */
    void deleteTable(Long uid, List<Long> tableIds);

    /**
     * 获取报表预览数据
     * @param uid
     * @param tid
     * @param sort
     * @param request
     * @return: com.springboot.demo.entity.PageResult
     */
    PageResult getTableData(Long uid, Long tid,String sort,PageRequest request);

    /**
     * 预览未保存报表
     * @param uid
     * @param table
     * @param sort
     * @param request
     * @return: com.springboot.demo.entity.PageResult
     */
    PageResult getUnSavedTableData(Long uid, Table table,String sort,PageRequest request);

    /**
     * 获取报表所有类型
     * @param
     * @return: java.util.List<com.springboot.demo.entity.TableType>
     */
    List<TableType> getTableTypes();

    /**
     * 获取报表数据表及其字段
     * @param
     * @return: java.util.List<com.springboot.demo.entity.TableDataTable>
     */
    List<TableDataTable> getTableDataTables();

    /**
     * 获取过滤字段数据
     * @param uid
     * @param dataTableNum
     * @param fieldNum
     * @param search
     * @return: java.util.List<java.lang.String>
     */
    List<String> getTableFieldData(Long uid, Integer dataTableNum, Integer fieldNum,String search);
}
